<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UserBindImpl
 *
 * @author Administrator
 */
namespace frontend\dao\impl;
use frontend\bean\UserBind;

use Yii;

class UserBindDaoImpl implements UserBindDao {

    public function getBindRecordByTypeId($type, $type_uid) {
        $connection = Yii::app()->db;
        $sql = "SELECT * FROM `user_bind` WHERE type=:type and type_uid = :type_uid  ";
        $command = $connection->createCommand();
        $command->bindValue(':type', $type);
        $command->bindValue(':type_uid', $type_uid);

        $result = $command->queryOne();
        return $result ? (new UserBind())->load($result) : null;
    }

//put your code here
}
